package cn.edu.zut.salarymanagesystem.utils;

import okhttp3.OkHttpClient;

public class Browser {
    private static OkHttpClient client;
    private static Browser instance = null;

    private static void initClient() {
        MyCookieJar myCookieJar = new MyCookieJar();
        client = new OkHttpClient.Builder().cookieJar(myCookieJar).build();
    }

    public static OkHttpClient getClient() {
        if (client == null)
            initClient();
        return client;
    }

    public static void flushClient() {
        client = null;
    }
}